package com.xnfh.home.viewmodel

import com.xnfh.framework.base.BaseViewModel
import com.xnfh.framework.bean.NewVersionHelpMessageBean
import com.xnfh.framework.bean.RespStateData
import com.xnfh.framework.bean.TidingBean

/**
 * @Description:
 * @Author: ziheng
 * @CreateDate: 2024/1/4 14:10
 * @UpdateUser: ziheng
 * @UpdateDate: 2024/1/4 14:10
 * @UpdateRemark: 更新说明
 */
class MessageViewModel : BaseViewModel() {
    private val viewModelRes = MessageViewModelRes()
    val tidingBeanS = RespStateData<List<TidingBean>>()
    val messageList = RespStateData<NewVersionHelpMessageBean>()

    /**
     * 获取首页 消息、俱乐部、反馈的一级类型页面
     */
    fun requestMessageOrOther(type: Int) = launch {
        viewModelRes.requestMessageOrOther(type, tidingBeanS)
    }

    /**
     * 获取三级消息列表数据,MessageDetailActivity使用，公用一个viewmodel
     */
    fun requestMessageList(page: Int, type: Int) = launch {
        viewModelRes.requestMessageList(page,type,messageList)
    }
}